﻿//
// Copyright © MixModes Inc. 2011
//

using System;

namespace MixModes.Phone.Synergy.Framework
{
    /// <summary>
    /// Data store interface
    /// </summary>
    public interface IDataStore : IDisposable
    {
        /// <summary>
        /// Stores the value in the data storage corresponding to the specified key
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="value">The value.</param>
        /// <returns>True if data was stored successfully, False otherwise</returns>
        bool Store(string key, object value);

        /// <summary>
        /// Retrieves the value in the data store corresponding to the specified key
        /// </summary>
        /// <typeparam name="T">Type of value</typeparam>
        /// <param name="key">The key.</param>
        /// <returns>Value corresponding to the key if there is one; default value otherwise</returns>
        T Retrieve<T>(string key);
    }
}
